﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CasignDesignGA.Casing;
using CasignDesingGA.Casing;
using CasignDesignGA.Casign;

namespace CasignDesignGA.Casing.CasignGenerator
{
    class MockCasignGenerator : ICasingGenerator
    {
        private long populationGenoma;

        public MockCasignGenerator(long populationGenoma)
        {
            // TODO: Complete member initialization
            this.populationGenoma = populationGenoma;
        }
     

        public ISelectable generateRandomCasing()
        {
            CasingDesign newCasing = new CasingDesign();
            Random ran = new Random(DateTime.Now.Millisecond);
            for (int i = 0; i < this.populationGenoma; i++)
            {
                CasingUnit unit = new CasingUnit();

                unit.Connection = ConnectionType.A;
                unit.Longitude = ran.Next();
                unit.MetricWeight = ran.NextDouble();
                unit.Od = ran.NextDouble();
                unit.Price = ran.NextDouble();
                unit.SteelGrade = "";

                newCasing.CasingCollection.Add(unit);

            }

            return newCasing;
        }
    }
}
